Xbasic

*seconds_between Function

Syntax

dim Result as N = *SECONDS_BETWEEN(t1 as T, t2 as T)

Arguments

t1Time

A datetime value.

t2Time

A datetime value

Returns

ResultNumeric

Returns the seconds between two dates or times. If t2 is a date or time later than t1, *SECONDS_BETWEEN will return a negative value.

Description

Return difference of seconds between two dates or times.

Example

dim now as t = now()

' wait a few seconds before typing the following into the interactive window:
dim someTimeLater as t = now()

? now
= 10/12/2017 11:47:06 82 am

? someTimeLater
= 10/12/2017 11:47:16 58 am

? *seconds_between(someTimeLater, now)
= 9.759

See Also